{% extends "base.html" %}
{% block  title %}系统用户详情{% endblock %}
{% block header-css %}

{% load	bootstrap3 %}
{% endblock %}


{% block page-content %}

    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>数据库用户详情</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="/index.html">主页</a>
                </li>
                <li>
                    <a href="/db/db-user.html">数据库用户管理</a>
                </li>
                <li class="active">
                    <strong>数据库用户详情</strong>
                </li>
            </ol>
        </div>
        <div class="col-lg-2">

        </div>
    </div>

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="panel-options">
                        <ul class="nav nav-tabs">
                            <li class="active">
                                <a class="text-center"><i class="fa fa-laptop"></i>用户详情</a>
                            </li>
                              <li>

                                <a class="text-center"  href="{% url "db:db_user_db"  nid  %}"  ><i class="fa fa-laptop"></i>关联资产</a>
                            </li>
                            <li class="pull-right">
                                <a class="btn btn-outline btn-default" href="{% url "db:db_user_update"  nid %}"><i
                                        class="fa fa-edit"></i>编辑</a>
                            </li>
                            <li class="pull-right">
                                <a class="btn btn-outline btn-danger  db_user_del">
                                    <i class="fa fa-edit"></i>删除
                                </a>
                            </li>

                        </ul>
                    </div>
                    <div class="tab-content">
                        <div class="col-sm-7" style="padding-left: 0">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <span class="label"><b>{{ dbusers.name }}</b></span>
                                    <div class="ibox-tools">
                                        <a class="collapse-link">
                                            <i class="fa fa-chevron-up"></i>
                                        </a>
                                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                            <i class="fa fa-wrench"></i>
                                        </a>
                                        <ul class="dropdown-menu dropdown-user">
                                        </ul>
                                        <a class="close-link">
                                            <i class="fa fa-times"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="ibox-content">

                                    <table class="table">
                                        <tbody>
                                        <tr>
                                            <td style=" border-top: none !important;" width="20%">名称</td>
                                            <td style=" border-top: none !important;"><b>{{ dbusers.name}}</b>
                                            </td>
                                        </tr>
                                         <tr>
                                            <td width="20%">登陆用户</td>
                                            <td><b>{{ dbusers.username }}</b></td>
                                        </tr>
                                         <tr>
                                            <td width="20%">产品线</td>
                                            <td><b>{{ dbusers.product_line }}</b></td>
                                        </tr>
                                        <tr>
                                            <td width="20%">备注</td>
                                            <td><b>{{ dbusers.ps }}</b></td>
                                        </tr>
                                        <tr>
                                            <td width="20%">创建时间</td>
                                            <td><b>{{ dbusers.ctime }}</b></td>
                                        </tr>
                                        <tr>
                                            <td width="20%">更新时间</td>
                                            <td><b>{{ dbusers.utime }}</b></td>
                                        </tr>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>




    {% block footer-js %}

              <script type="text/JavaScript">
    $.ajaxSetup({headers: {"X-CSRFToken": '{{ csrf_token }}'}});
</script>

        <script>

         $(function () {

                $('.db_user_del').click(function () {


                        swal({

                        title: "你确定删除",
                        text: "你将无法恢复",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "确定",
                        closeOnConfirm: false
                    }, function () {


                    $.ajax({
                        url: "/db/db-user-del.html",
                        type: 'POST',
                       data: {'nid': {{nid}} },
                            success: function (data) {
                                var obj = JSON.parse(data);
                                if (obj.status) {
                                    swal({title: "删除", text: "已成功删除", type: "success"}, function () {
                                        location.href = "{% url "db:db_user_list" %}"
                                    })
                                } else {
                                    swal("错误", "删除" + "[ " + obj.error + " ]" + "遇到错误", "error");
                                }
                        }
                    })
                });
 });

            });


        </script>


    {% endblock %}


{% endblock %}


